<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:replace="${title}">博客详情</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
    <link rel="stylesheet" href="../static/layui/css/layui.css" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" href="../static/css/typo.css" th:href="@{/css/typo.css}">
    <link rel="stylesheet" href="../static/css/animate.css" th:href="@{/css/animate.css}">
    <link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{/lib/prism/prism.css}">
    <link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{/lib/tocbot/tocbot.css}">
    <link rel="stylesheet" href="../static/css/timeline.css" th:href="@{/css/timeline.css}">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
    <script type="text/javascript">

        $(function () {
            var addr = $("#headPortrait").html();
            $("#img").attr("src", addr);
        });

    </script>
</head>
<body>


<!--导航-->
<div th:fragment="menu(n)">
    <nav class="gird-header">
            <div class="ui inverted secondary stackable menu">
                <h2 class="ui teal header item" style="font-family: 'YaHei Consolas Hybrid';margin-left: 200px">
                    Blog</h2>
                <a href="#" style="margin-left: 50px" th:href="@{/front/blog/showAll}" class="m-item item m-mobile-hide"
                   th:classappend="${n == 1} ? 'active'"><i
                        class="mini home icon"></i>&nbsp;<span style="font-size: 22px;font-family: 华文行楷">首页</span></a>
                <a href="#" th:href="@{/front/type/showAll}" class="m-item item m-mobile-hide"
                   th:classappend="${n == 2} ? 'active'"><i
                        class="mini idea icon"></i>&nbsp;<span style="font-size: 22px;font-family: 华文行楷">分类</span></a>
                <a href="#" th:href="@{/front/tag/showAll}" class="m-item item m-mobile-hide"
                   th:classappend="${n == 3} ? 'active'"><i
                        class="mini tags icon"></i>&nbsp;<span style="font-size: 22px;font-family: 华文行楷">标签</span></a>
                <a href="#" th:href="@{/front/archive/showAll}" class="m-item item m-mobile-hide"
                   th:classappend="${n == 4} ? 'active'"><i
                        class="mini clone icon"></i>&nbsp;<span style="font-size: 22px;font-family: 华文行楷">归档</span></a>
                <a href="#" th:href="@{/front/time/timeAxis}" class="m-item item m-mobile-hide"
                   th:classappend="${n == 5} ? 'active'"><i
                        class="mini clock outline icon"></i>&nbsp;<span
                        style="font-size: 22px;font-family: 华文行楷">时间轴</span></a>
                <!--<a href="#" th:href="@{/}" class="m-item item m-mobile-hide" th:classappend="${n == 6} ? 'active'"><i-->
                <!--class="mini share square icon"></i>&nbsp;<span style="font-size: 22px;font-family: 华文行楷">我的收藏</span></a>-->
                <a href="#" th:href="@{/front/link/showAll}" class="m-item item m-mobile-hide"
                   th:classappend="${n == 7} ? 'active'"><i
                        class="mini linkify icon"></i>&nbsp;<span
                        style="font-size: 22px;font-family: 华文行楷">友链</span></a>
                <a href="#" th:href="@{/front/message/messages}" class="m-item item m-mobile-hide"
                   th:classappend="${n == 8} ? 'active'"><i
                        class="mini edit outline icon"></i>&nbsp;<span
                        style="font-size: 22px;font-family: 华文行楷">留言板</span></a>
                <a href="#" th:href="@{/front/about/about}" class="m-item item m-mobile-hide"
                   th:classappend="${n == 9} ? 'active'"><i
                        class="mini info icon"></i><span style="font-size: 22px;font-family: 华文行楷">关于本站</span></a>
                <div class="right m-item item m-mobile-hide">
                    <form name="search" action="#" th:action="@{/front/blog/search}" target="_blank">
                        <div class="ui icon inverted transparent input m-margin-tb-tiny">
                            <input id="searchContent" type="text" th:value="${searchContent}" name="searchContent"
                                   placeholder="Search....">
                            <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                        </div>
                    </form>

                </div>
                <a sec:authorize="!isAuthenticated()" class="m-item item m-mobile-hide" href="#"
                   th:href="@{/user/login}"><i
                        class="mini shield alternate icon" style="color:red;font-size: 14px"></i><span
                        style="font-size: 22px;font-family: 华文行楷;color: red">点击登录</span></a>
                <div class="m-item m-ma see-hide menu" style="float: right;margin-right: 50px"
                     sec:authorize="isAuthenticated()">
                    <div class="ui dropdown  item">
                        <div class="text"><span style="display: none" id="headPortrait" sec:authentication="principal.headPortrait"></span>
                            <img class="ui avatar image" id="img"/>
                            <span sec:authentication="principal.nickname"></span>
                        </div>
                        <i class="dropdown icon"></i>
                        <div class="menu">
                            <a href="#" th:href="@{/logout}" class="item">注销</a>
                            <a href="#" th:href="@{/user/toUpdateNickname}" class="item">修改昵称</a>
                            <a href="#" th:href="@{/user/toUpdatePassword}" class="item">修改密码</a>
                            <!--<a href="#" th:href="@{/admin/}" class="item" sec:authentication="hasRole('ADMIN')">后台首页</a>-->
                            <a href="#" th:href="@{/user/toUpload}" class="item">更换头像</a>
                        </div>
                    </div>
                </div>
        </div>
        <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
            <i class="sidebar icon"></i>
        </a>
    </nav>
    <br>
    <br>
    <br>
</div>
<!-- 底部 -->
<footer class="ui inverted vertical segment m-padded-tb-massive m-opacity" th:fragment="footer">
    <div class="ui center aligned container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../static/images/wechat.jpg" th:src="@{/images/wechat.jpg}" class="ui rounded image"
                             alt="" style="width: 110px">
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">热点博文</h4>
                <div id="hotBlogs">
                    <div class="ui inverted link list" th:fragment="hotBlogs">
                        <a href="#" th:href="@{'/front/blog/details?id='+${blog.id}}" target="_blank"
                           class="item m-text-thin" th:each="blog:${blogs}" th:text="${blog.title}">用户故事（User Story）</a>
                        <!--/*-->
                        <a href="#" class="item m-text-thin">用户故事（User Story）</a>
                        <a href="#" class="item m-text-thin">用户故事（User Story）</a>
                        <!--*/-->
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
                <div class="ui inverted link list">
                    <a href="#" disabled="true" class="item m-text-thin">Email：<span th:text="#{admin.email}">2605811855@qq.com</span></a>
                    <a href="#" disabled="true" class="item m-text-thin">QQ：<span
                            th:text="#{admin.qq}">2605811855</span></a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">Blog</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini" th:text="#{admin.share}">
                    这是我的个人博客、会分享关于编程、写作、思考相关的任何内容，希望可以给来到这儿的人有所帮助...</p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright © 2020 - <span>2020</span> &nbsp;CPP &nbsp;
            Designed by Zhang peng</p>
        <p class="m-text-thin m-text-spaced"><a style="color: blue" href="http://icp.chinaz.com/info?q=zhangzied.cn">
            赣ICP备20008460号-1</a></p>
        <div style="width:300px;margin:0 auto; padding:1px 0; ">
            <!--            <a target="_blank" href="http://www.beian.gov.cn" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img th:src="@{/images/1.png}" style="float:left;"/><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#ff1c04;">桂公网安备</p></a>-->
        </div>
        <span id="timeDate">载入天数...</span><span id="times">载入时分秒...</span>
        <script>
            var now = new Date();

            function createtime() {
                var grt = new Date("06/19/2020 00:00:00");//在此处修改你的建站时间，格式：月/日/年 时:分:秒
                now.setTime(now.getTime() + 250);
                days = (now - grt) / 1000 / 60 / 60 / 24;
                dnum = Math.floor(days);
                hours = (now - grt) / 1000 / 60 / 60 - (24 * dnum);
                hnum = Math.floor(hours);
                if (String(hnum).length == 1) {
                    hnum = "0" + hnum;
                }
                minutes = (now - grt) / 1000 / 60 - (24 * 60 * dnum) - (60 * hnum);
                mnum = Math.floor(minutes);
                if (String(mnum).length == 1) {
                    mnum = "0" + mnum;
                }
                seconds = (now - grt) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
                snum = Math.round(seconds);
                if (String(snum).length == 1) {
                    snum = "0" + snum;
                }
                document.getElementById("timeDate").innerHTML = "本站已安全运行 " + dnum + " 天 ";
                document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒";
            }

            setInterval("createtime()", 500);
        </script>
    </div>
    <script type="text/javascript" th:inline="javascript">
        $(function () {
            $("#hotBlogs").load(/*[[@{/front/blog/getHotBlogs}]]*/"/front/blog/getHotBlogs");
        });
    </script>
</footer>
<script type="text/javascript" th:fragment="script">

    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

    //头像下拉框
    $('.ui.dropdown').dropdown({
        on: 'hover'
    });

</script>
</body>
</html>